package com.fjec.user.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fjec.common.util.DateUtil;
import com.fjec.user.entity.SysUserLoginLog;
import com.fjec.user.mapper.SysUserLoginLogMapper;
import com.fjec.user.service.ISysUserLoginLogService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * <p>
 * 011.用户登录日志表 服务实现类
 * </p>
 *
 * @author admin
 * @since 2020-08-31
 */
@Service
public class SysUserLoginLogServiceImpl extends ServiceImpl<SysUserLoginLogMapper, SysUserLoginLog> implements ISysUserLoginLogService {

    @Resource
    private SysUserLoginLogMapper mapper;

    @Override
    public void saveLoginLog(Long userId, Integer appType) {
        SysUserLoginLog entity = new SysUserLoginLog();
        entity.setUserId(userId);
        entity.setAppType(appType);
        entity.setCreateTime(DateUtil.nowLdt());
        mapper.insert(entity);
    }
}
